The present invention generally relates to an image data compression method to be applied to image coding devices for reversibly coding n-bit images including characters, graphic patterns or the like (referred to as character images hereinbelow) with high efficiency.
Generally, in order to obtain a good character image with a comparatively low resolution, it is necessary to represent pixels of the image with multiple gray levels. A character image usually has character portions, white background and edge portions which are in the boundary between the character portions and the white background. In order to represent pixels of a character image with multiple gray level, pixels of the image are assigned respective values such as, for example, 0 for the character portions, (2.sup.n -1) for the white background, 1 to (2.sup.n -2) for the edge portions, wherein n.gtoreq.2. Such n-bit image data are then coded.
Such pixel values are obtained by preprocessing image data read through a scanner, a camera, or the like.
FIG. 10 shows a prior art image data compression method employed in coding pixel values. The prior art method divides the n-bit image data into n bit planes and codes each bit plane by a run length coding method. According to the run length coding method, a long run can be compressed such that, instead of repeating the same data of the run, a code indicating the run length and a code indicating the type or value of the repeated data are inserted such that data compression is effected.
According to the prior data compression method using the bit plane dividing method as shown in FIG. 10, the binary data at the pixel positions representing a character portion are zeros (0) for all the bit planes, the binary data at the pixel positions representing white background are ones (1) for all the bit planes. That is, every bit on the bit planes carries same binary data at pixel positions for image portions other than the edge portions. However, because the edge portions occupies a very limited area in the image, the bit planes will have a pattern similar to each other. Therefore, it is inefficient to code these bit planes separately using the run length coding because too much redundancy is required.